FOREACH(NAME server client)
  FILE(GLOB CHAT_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${NAME}/*.cpp")
  SET(TARGET_NAME "")
  STRING(APPEND TARGET_NAME chat_ ${NAME})
  ADD_EXECUTABLE(${TARGET_NAME} ${CHAT_SOURCE})
  TARGET_LINK_LIBRARIES(${TARGET_NAME} net)
ENDFOREACH()

